package psi

import (
	"fmt"
	"strings"
)

/*
取下手环报警开关
平台发送:
[DW*YYYYYYYYYYYYYYY*LEN*REMOVE,0 或者 1]
实例:[DW*334588000000156*0008*REMOVE,1]
终端回复:
[DW*YYYYYYYYYYYYYYY*LEN*REMOVE]
实例:[DW*334588000000156*0006*REMOVE]
说明:手表拆除报警的开关，1 打开，0 关闭.
*/

// 取下手环报警开关
type REMOVE struct {
	Switch int // 0 或者 1
}

func DealREMOVE(method string, params map[string]interface{}) (string, error) {
	var remove REMOVE
	err := MapToStruct(params, &remove)
	if err != nil {
		return "", err
	}
	var messageList []string
	messageList = append(messageList, "REMOVE")
	messageList = append(messageList, fmt.Sprint(remove.Switch))
	message := strings.Join(messageList, ",")
	return message, nil
}
